Skip to main content
PATCH
/
preview
/
safety-events
/
batch
[preview] Update Safety Events
curl --request PATCH \
  --url https://api.samsara.com/preview/safety-events/batch \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "safetyEventIds": [
    "bb2ff5ab-30ad-49ec-9d2d-55ec30bbf590",
    "bb2ff5ab-30ad-49ec-9d2d-55ec30bbf590",
    "bb2ff5ab-30ad-49ec-9d2d-55ec30bbf590"
  ],
  "contextLabelsToAdd": [
    "Snowing",
    "Wet Road",
    "Passengers",
    "Defensive"
  ],
  "contextLabelsToRemove": [
    "Congested",
    "Passenger Mobile Usage",
    "Passenger Sleeping",
    "Snowing"
  ],
  "eventState": "needsReview"
}
'
{
  "requestId": "a1b2c3d4-e5f6-7890-abcd-ef1234567890",
  "responses": [
    {
      "data": {
        "safetyEventId": "bb2ff5ab-30ad-49ec-9d2d-55ec30bbf590"
      },
      "status": 202
    }
  ]
}

Documentation Index

Fetch the complete documentation index at: https://samsara-showcase.mintlify.app/llms.txt

Use this file to discover all available pages before exploring further.

Authorizations

Authorization
string
header
required

Bearer authentication header of the form Bearer <token>, where <token> is your auth token.

Body

application/json

Request body for updating Safety Events. At least one of eventState, contextLabelsToAdd, or contextLabelsToRemove must be provided. Maximum 200 IDs per request.

safetyEventIds
string[]
required

IDs of the Safety Events to update. Maximum 200.

The unique Samsara ID (uuid) of the safety event.

Example:
[
"bb2ff5ab-30ad-49ec-9d2d-55ec30bbf590",
"bb2ff5ab-30ad-49ec-9d2d-55ec30bbf590",
"bb2ff5ab-30ad-49ec-9d2d-55ec30bbf590"
]
contextLabelsToAdd
enum<string>[]

Context labels to add to the Safety Events.

A context label to add. Valid values: Congested, Construction, Coupling/Uncoupling, Cyclist/Motorcyclist, Defensive, Fog, Improper Seat Belt, Light Traffic, Moderate Traffic, Moderately Drowsy, Mounted Phone, Night, Parking Lot, Passenger Mobile Usage, Passenger Sleeping, Passengers, Pedestrians, Raining, Sensitive Media, Slightly Drowsy, Snowing, Snowy Road, Speed Sign Verified, Very Drowsy, Wet Road, Wildlife

Available options:
Congested,
Construction,
Coupling/Uncoupling,
Cyclist/Motorcyclist,
Defensive,
Fog,
Improper Seat Belt,
Light Traffic,
Moderate Traffic,
Moderately Drowsy,
Mounted Phone,
Night,
Parking Lot,
Passenger Mobile Usage,
Passenger Sleeping,
Passengers,
Pedestrians,
Raining,
Sensitive Media,
Slightly Drowsy,
Snowing,
Snowy Road,
Speed Sign Verified,
Very Drowsy,
Wet Road,
Wildlife
Example:
[
"Snowing",
"Wet Road",
"Passengers",
"Defensive"
]
contextLabelsToRemove
enum<string>[]

Context labels to remove from the Safety Events.

A context label to remove. Valid values: Congested, Construction, Coupling/Uncoupling, Cyclist/Motorcyclist, Defensive, Fog, Improper Seat Belt, Light Traffic, Moderate Traffic, Moderately Drowsy, Mounted Phone, Night, Parking Lot, Passenger Mobile Usage, Passenger Sleeping, Passengers, Pedestrians, Raining, Sensitive Media, Slightly Drowsy, Snowing, Snowy Road, Speed Sign Verified, Very Drowsy, Wet Road, Wildlife

Available options:
Congested,
Construction,
Coupling/Uncoupling,
Cyclist/Motorcyclist,
Defensive,
Fog,
Improper Seat Belt,
Light Traffic,
Moderate Traffic,
Moderately Drowsy,
Mounted Phone,
Night,
Parking Lot,
Passenger Mobile Usage,
Passenger Sleeping,
Passengers,
Pedestrians,
Raining,
Sensitive Media,
Slightly Drowsy,
Snowing,
Snowy Road,
Speed Sign Verified,
Very Drowsy,
Wet Road,
Wildlife
Example:
[
"Congested",
"Passenger Mobile Usage",
"Passenger Sleeping",
"Snowing"
]
dismissalReason
object

Dismissal reason. Required when eventState is dismissed. Must not be provided for other states.

eventState
enum<string>

The new state to apply to all specified Safety Events. Valid values: needsReview, reviewed, needsCoaching, coached, dismissed, needsRecognition, recognized

Available options:
needsReview,
reviewed,
needsCoaching,
coached,
dismissed,
needsRecognition,
recognized
Example:

"needsReview"

Response

Accepted response.

requestId
string
required

Server-generated UUID for client-side correlation and logging. Not stored or queryable on the backend.

Example:

"a1b2c3d4-e5f6-7890-abcd-ef1234567890"

responses
object[]
required

One entry per requested safetyEventId, in the same order as the request.